<!doctype HTML public "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- Click to Convert 5.2: Anything to HTML -->
<!-- http://www.clicktoconvert.com -->

<html>
<head>
<title>gravityboxscheduleuserguide - page 41 of 234</title>
<meta http-equiv=content-type content=text/html;charset=iso-8859-1>
<meta name="Generator" content="Click to Convert">

<!--Start of page styles-->
<STYLE TYPE="text/css">
<!--
 /* Foreground Image Styles */

 /* Position Styles */
 .ts41p0{position:absolute;left:106px;top:97px;}
 .ts41p1{position:absolute;left:352px;top:97px;}
 .ts41p3{position:absolute;left:672px;top:97px;}
 .ts41p7{position:absolute;left:106px;top:113px;}
 .ts41p8{position:absolute;left:706px;top:1026px;}
 .ts41p9{position:absolute;left:331px;top:1044px;}
 .ts41p13{position:absolute;left:106px;top:146px;}
 .ts41p15{position:absolute;left:106px;top:164px;}
 .ts41p17{position:absolute;left:106px;top:183px;}
 .ts41p18{position:absolute;left:106px;top:202px;}
 .ts41p20{position:absolute;left:106px;top:220px;}
 .ts41p21{position:absolute;left:106px;top:238px;}
 .ts41p23{position:absolute;left:106px;top:257px;}
 .ts41p25{position:absolute;left:106px;top:275px;}
 .ts41p27{position:absolute;left:106px;top:293px;}
 .ts41p28{position:absolute;left:106px;top:312px;}
 .ts41p29{position:absolute;left:106px;top:330px;}
 .ts41p31{position:absolute;left:106px;top:348px;}
 .ts41p32{position:absolute;left:106px;top:367px;}
 .ts41p34{position:absolute;left:106px;top:385px;}
 .ts41p35{position:absolute;left:106px;top:405px;}
 .ts41p37{position:absolute;left:106px;top:423px;}
 .ts41p39{position:absolute;left:106px;top:441px;}
 .ts41p40{position:absolute;left:106px;top:459px;}
 .ts41p43{position:absolute;left:106px;top:477px;}
 .ts41p45{position:absolute;left:106px;top:495px;}
 .ts41p47{position:absolute;left:106px;top:513px;}
 .ts41p49{position:absolute;left:106px;top:531px;}
 .ts41p51{position:absolute;left:106px;top:550px;}
 .ts41p53{position:absolute;left:106px;top:568px;}
 .ts41p54{position:absolute;left:106px;top:586px;}
 .ts41p55{position:absolute;left:106px;top:605px;}
 .ts41p57{position:absolute;left:106px;top:623px;}
 .ts41p58{position:absolute;left:106px;top:642px;}
 .ts41p60{position:absolute;left:106px;top:660px;}
 .ts41p61{position:absolute;left:106px;top:679px;}
 .ts41p63{position:absolute;left:106px;top:698px;}
 .ts41p64{position:absolute;left:106px;top:716px;}
 .ts41p67{position:absolute;left:106px;top:734px;}
 .ts41p69{position:absolute;left:106px;top:752px;}
 .ts41p71{position:absolute;left:106px;top:770px;}
 .ts41p73{position:absolute;left:106px;top:788px;}
 .ts41p74{position:absolute;left:106px;top:807px;}
 .ts41p75{position:absolute;left:106px;top:825px;}
 .ts41p78{position:absolute;left:106px;top:844px;}
 .ts41p79{position:absolute;left:106px;top:863px;}
 .ts41p81{position:absolute;left:106px;top:881px;}
 .ts41p83{position:absolute;left:106px;top:900px;}
 .ts41p84{position:absolute;left:106px;top:918px;}
 .ts41p85{position:absolute;left:106px;top:936px;}
 .ts41p86{position:absolute;left:106px;top:955px;}
 .ts41p88{position:absolute;left:106px;top:973px;}

 /* Font Styles */
 .ft0p41{font-style:normal;font-weight:bold;font-size:13px;font-family:arial,sans-serif;color:#000000;}
 .ft1p41{font-weight:normal;}
 .ft2p41{font-style:normal;font-weight:normal;font-size:13px;font-family:"times new roman","times new roman",times,serif;color:#000000;}
 .ft3p41{font-style:normal;font-weight:normal;font-size:16px;font-family:"times new roman","times new roman",times,serif;color:#000000;}
 .ft4p41{font-style:normal;font-weight:bold;font-size:11px;font-family:arial,sans-serif;color:#000000;}
 .ft5p41{font-style:normal;font-weight:normal;font-size:16px;font-family:arial,sans-serif;color:#000000;}
 .ft6p41{font-style:normal;font-weight:normal;font-size:16px;font-family:"courier new",courier,monospace;color:#000000;}

 /* Background Style */
 .styleBackground41{position:absolute;left:97px;top:200px}

 /* Navigation Styles */
 .styleNavBarTop{position:absolute;left:0px;top:2px}
 .nb{position:absolute;left:2px;top:0px}
 .nbs{position:absolute;left:0px;top:0px}
 .nbe{position:absolute;left:836px;top:0px}
 .styleNavBarBot{position:absolute;left:0px;top:1117px}
-->
</STYLE>
<!--End of page styles-->

</head>
<body bgcolor="#ffffff" text="#000000" link="#0000FF" Vlink="#660099">

<table id="pageTable" width="836" STYLE="position: relative; left: auto; top: auto;"><tr><td>
<div class=nbs><img src="./navbarstart.gif" width="2" height="30"></div>
<div class=nb><img src="./navbar.gif" width="836" height="30" alt="Navigation bar"></div>
<div class=nbe><img src="./navbarend.gif" width="2" height="30"></div>
<div class=styleNavBarTop>
<table width="834" height="26" border="0" cellspacing="0">
  <tr align="left">
    <td width="4">&nbsp;</td>
    <td width="25" align="center"><a href="http://www.gravitybox.com" target="_parent"><img src="./home.gif" border="0" alt="Home"></a></td>
    <td width="25" align="center"><a href="#" onClick="window.open('./print.html','Printing','width=300,height=100,toolbar=no,directories=no');return false;"><img src="./print.gif" border="0" alt="Print document"></a></td>
    <td width="10" align="center"><img src="./separator.gif" border="0"></td>
    <td width="18" align="center"><a href="./index1.html"><img src="./start.gif" width="18" height="14" border="0" alt="Start"></a></td>
    <td width="18" align="center"><a href="./index40.html"><img src="./back.gif" width="14" height="14" border="0" alt="Previous page"></a></td>
    <td width="80" valign="middle"><table width="100%" height="16" border="0" cellspacing="1" bgcolor="#ACA899"><tr><td align="center" bgcolor="#ffffff"><font face=verdana,arial,sans-serif><font size="1">&nbsp;41 of 234&nbsp;</font></font></td></tr></table></td>
    <td width="18" align="center"><a href="./index42.html"><img src="./forward.gif" width="14" height="14" border="0" alt="Next page"></a></td>
    <td width="18" align="center"><a href="./index234.html"><img src="./end.gif" width="18" height="14" border="0" alt="End"></a></td>
    <td width="620">&nbsp;</td>
  </tr>
</table>
<p>
</div>
<nobr>
<div class=styleBackground41><img src="./background41.png" width="633" height="855" border="0" alt=""></div>
<div class=ts41p0><span class="ft0p41"> </span></div>
<div class=ts41p1><span class="ft0p41">Gravitybox Schedule Primer<span class="ft1p41"> </span></span></div>
<div class=ts41p3><span class="ft0p41">Page 39&nbsp; </span></div>
<div class=ts41p7><span class="ft2p41"> </span></div>
<div class=ts41p8><span class="ft3p41"> </span></div>
<div class=ts41p9><span class="ft4p41">1998&#45;2004 Gravitybox Software LLC<span class="ft3p41"> </span></span></div>
<div class=ts41p13><span class="ft5p41">first to the last element, each time referencing the Item method of the collection by </span></div>
<div class=ts41p15><span class="ft5p41">index. </span></div>
<div class=ts41p17><span class="ft5p41"> </span></div>
<div class=ts41p18><span class="ft6p41">Dim i As Long </span></div>
<div class=ts41p20><span class="ft6p41"> </span></div>
<div class=ts41p21><span class="ft6p41">&nbsp; For i = 1 To Schedule1.ScheduleItems.Count </span></div>
<div class=ts41p23><span class="ft6p41">&nbsp;&nbsp;&nbsp; Schedule1.ScheduleItems(i).Id = i </span></div>
<div class=ts41p25><span class="ft6p41">&nbsp; Next I<span class="ft5p41"> </span></span></div>
<div class=ts41p27><span class="ft5p41"> </span></div>
<div class=ts41p28><span class="ft5p41">The second way to loop through a collection is by creating an object variable, of an </span></div>
<div class=ts41p29><span class="ft5p41">appropriate type, and using it, to set the property values. The object variable is set to a </span></div>
<div class=ts41p31><span class="ft5p41">member of the collection, used, and released. This is much easier to read, but still </span></div>
<div class=ts41p32><span class="ft5p41">rather awkward. </span></div>
<div class=ts41p34><span class="ft5p41"> </span></div>
<div class=ts41p35><span class="ft6p41">Dim oAppt As CScheduleEl </span></div>
<div class=ts41p37><span class="ft6p41">Dim i As Long </span></div>
<div class=ts41p39><span class="ft6p41"> </span></div>
<div class=ts41p40><span class="ft6p41">&nbsp; For i = 1 To Schedule1.ScheduleItems.Count </span></div>
<div class=ts41p43><span class="ft6p41">&nbsp;&nbsp;&nbsp; Set oAppt = Schedule1.ScheduleItems(i) </span></div>
<div class=ts41p45><span class="ft6p41">&nbsp;&nbsp;&nbsp; oAppt.MinLength = 60 </span></div>
<div class=ts41p47><span class="ft6p41">&nbsp;&nbsp;&nbsp; oAppt.MaxLength = 120 </span></div>
<div class=ts41p49><span class="ft6p41">&nbsp;&nbsp;&nbsp; Set oAppt = Nothing </span></div>
<div class=ts41p51><span class="ft6p41">&nbsp; Next I<span class="ft5p41"> </span></span></div>
<div class=ts41p53><span class="ft5p41"> </span></div>
<div class=ts41p54><span class="ft5p41">The third way is the easiest to read. It lets the collection do the loop. There is no loop </span></div>
<div class=ts41p55><span class="ft5p41">counter, as in the other two examples. An object variable is declared and the collection </span></div>
<div class=ts41p57><span class="ft5p41">loops through all of its own items. The following syntax allows the collection to do the </span></div>
<div class=ts41p58><span class="ft5p41">looping work and takes some of the coding away from the developer. </span></div>
<div class=ts41p60><span class="ft5p41"> </span></div>
<div class=ts41p61><span class="ft6p41">Dim oAppt As CScheduleEl </span></div>
<div class=ts41p63><span class="ft6p41"> </span></div>
<div class=ts41p64><span class="ft6p41">&nbsp; For Each oAppt In Schedule1.ScheduleItems </span></div>
<div class=ts41p67><span class="ft6p41">&nbsp;&nbsp;&nbsp; oAppt.MinLength = 60 </span></div>
<div class=ts41p69><span class="ft6p41">&nbsp;&nbsp;&nbsp; oAppt.MaxLength = 120 </span></div>
<div class=ts41p71><span class="ft6p41">&nbsp; Next<span class="ft5p41"> </span></span></div>
<div class=ts41p73><span class="ft5p41"> </span></div>
<div class=ts41p74><span class="ft5p41">In this code, is can be seen that there is no explicit call the to the Item method of the </span></div>
<div class=ts41p75><span class="ft5p41">collection. The call is implicit. The following two code fragments are equivalent. </span></div>
<div class=ts41p78><span class="ft5p41"> </span></div>
<div class=ts41p79><span class="ft6p41">Debug.Print ScheduleItems(1).Name </span></div>
<div class=ts41p81><span class="ft6p41">Debug.Print ScheduleItems.Item(1).Name<span class="ft5p41"> </span></span></div>
<div class=ts41p83><span class="ft5p41"> </span></div>
<div class=ts41p84><span class="ft5p41"> </span></div>
<div class=ts41p85><span class="ft5p41">The Item method is the default method of all collections in GbSchedule. There is no </span></div>
<div class=ts41p86><span class="ft5p41">need to specify a call to this method explicitly. There is also a speed issue to consider </span></div>
<div class=ts41p88><span class="ft5p41">when looping. The third looping example is the fastest way to create a loop. An object </span></div>
<div class=styleNavBarBot>
<table width="836" border="0" cellspacing="2">
  <tr></tr>
  <tr>
    <td width="118"><a href="http://www.purepage.com"><img src="./smalllogo.gif" width="118" height="46" border="0" alt="http://www.purepage.com"></a></td>
    <td></td>
  </tr>
</table>
</div>

</td></tr></table>

</body>
</html>
